package com.fit.toysShop.pages;

import java.util.LinkedList;

import org.apache.tapestry5.annotations.*;
import org.apache.tapestry5.ioc.annotations.*;

import com.fit.toysShop.beans.SellerBean;
import com.fit.toysShop.interfaces.Purchase;
import com.fit.toysShop.interfaces.Seller;
import com.fit.toysShop.service.Sellers;

public class EntrySeller {
	@Property
	@Persist
	private Seller seller;
	@Inject
	private Sellers sellers;

	@SetupRender
	public void createObject() {
		seller = new SellerBean();
		seller.setPurchases(new LinkedList<Purchase>());

	}

	public void onSuccess() {
		seller.executeSellerCreation(sellers);
		//sellers.save(seller);
	}

}
